package com.aaa.service.impl;

import com.aaa.dao.ZcglPrivatelandDao;
import com.aaa.entity.ZcglPrivate;
import com.aaa.entity.ZcglPrivateland;
import com.aaa.service.ZcglPrivatelandService;
import com.aaa.util.Result;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * (ZcglPrivateland)表服务实现类
 *
 * @author makejava
 * @since 2021-01-30 14:15:55
 */
@Service("zcglPrivatelandService")
public class ZcglPrivatelandServiceImpl extends ServiceImpl<ZcglPrivatelandDao, ZcglPrivateland> implements ZcglPrivatelandService {

    @Autowired
    private ZcglPrivatelandDao dao;


    @Override
    public Result listAll() {
        List<ZcglPrivateland> list = dao.selectList(null);
        if (list!=null){
            return new Result(1003,"成功",list);
        }
        return null;
    }

    /**
     * create by: Student洋
     * description: 查询单条全部数据
     */
    @Override
    public List<ZcglPrivate> selectOne(String assetNumber) {
        List<ZcglPrivate> list = dao.selectOneByAsset(assetNumber);
        return list;
    }
    /**
     * create by: Student洋
     * description: 逻辑删除，修改当前列的状态码
     */
    @Override
    public boolean delete(String assetNumber) {
        boolean del =dao.delByassetNumber(assetNumber);
        return del;
    }
    /**
     * create by: Student洋
     * description: 向自有土地信息表中添加数据
     */

    @Override
    public int addPrivate(ZcglPrivate add) {
        int a = dao.addPrivate(add);
        return a;
    }
    /**
     * create by: Student洋
     * description: 向拆分的公共表中添加数据
     */
    @Override
    public int addHouse(ZcglPrivate add) {
        int b = dao.addHouse(add);
        return b;
    }
    /**
     * create by: Student洋
     * description: 修改自有土地信息表中的数据
     */
    @Override
    public int updatePrivate(ZcglPrivate update) {
        int a = dao.updatePrivate(update);
        return a ;
    }
    /**
     * create by: Student洋
     * description: 修改拆分的公共表中的数据
     */
    @Override
    public int updateHouse(ZcglPrivate update) {
        int b = dao.updateHouse(update);
        return b ;
    }
}